<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\ResourceCollection;

class NewsCollection extends ResourceCollection
{
    /**
     * Transform the resource collection into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'data' => $this->collection,
        ];
//        return [
//            'id' => $this->id,
//            'title' => $this->title,
//            'summary' => $this->summary,
//            'view_counts' => $this->view_counts,
//            'comment_counts' => $this->comment_counts,
//            'thumb_up_counts' => $this->thumb_up_counts,
//            'created_at' => $this->created_at,
//            'updated_at' => $this->updated_at
//        ];
    }
}
